module.exports = app => {
  const moduleInfo = app.meta.mockUtil.parseInfoFromPackage(__dirname);
  const resources = [
    // menu
    {
      atomName: 'Create Layout',
      atomStaticKey: 'createLayout',
      atomRevision: -1,
      atomCategoryId: 'a-base:menu.Create',
      resourceType: 'a-base:menu',
      resourceConfig: JSON.stringify({
        module: moduleInfo.relativeName,
        atomClassName: 'layout',
        atomAction: 'create',
      }),
      resourceRoles: 'template.system',
    },
    {
      atomName: 'Layout List',
      atomStaticKey: 'listLayout',
      atomRevision: -1,
      atomCategoryId: 'a-base:menu.List',
      resourceType: 'a-base:menu',
      resourceConfig: JSON.stringify({
        module: moduleInfo.relativeName,
        atomClassName: 'layout',
        atomAction: 'read',
      }),
      resourceRoles: 'template.system',
    },
    // panels
    {
      atomName: 'Menu',
      atomStaticKey: 'panelMenu',
      atomRevision: -1,
      atomCategoryId: 'a-layoutpc:panel.General',
      resourceType: 'a-layoutpc:panel',
      resourceConfig: JSON.stringify({
        url: '/a/basefront/resource/tree',
      }),
      resourceRoles: 'root',
    },
    {
      atomName: 'Atom',
      atomStaticKey: 'panelAtom',
      atomRevision: -1,
      atomCategoryId: 'a-layoutpc:panel.General',
      resourceType: 'a-layoutpc:panel',
      resourceConfig: JSON.stringify({
        url: '/a/basefront/atom/list',
      }),
      resourceRoles: 'root',
    },
    {
      atomName: 'Search',
      atomStaticKey: 'panelSearch',
      atomRevision: -1,
      atomCategoryId: 'a-layoutpc:panel.General',
      resourceType: 'a-layoutpc:panel',
      resourceConfig: JSON.stringify({
        url: '/a/basefront/atom/searchQuick',
      }),
      resourceRoles: 'root',
    },
    {
      atomName: 'Mine',
      atomStaticKey: 'panelMine',
      atomRevision: 0,
      atomCategoryId: 'a-layoutpc:panel.General',
      resourceType: 'a-layoutpc:panel',
      resourceConfig: JSON.stringify({
        url: '/a/user/user/mine',
      }),
      resourceRoles: 'root',
    },
    // buttons
    {
      atomName: 'Home',
      atomStaticKey: 'buttonAppHome',
      atomRevision: 4,
      atomCategoryId: 'a-layoutpc:button.General',
      resourceType: 'a-layoutpc:button',
      resourceConfig: JSON.stringify({
        module: moduleInfo.relativeName,
        component: 'buttonAppHome',
        icon: { f7: '::home' },
      }),
      resourceRoles: 'root',
    },
    {
      atomName: 'Search',
      atomStaticKey: 'buttonSearch',
      atomRevision: 0,
      atomCategoryId: 'a-layoutpc:button.General',
      resourceType: 'a-layoutpc:button',
      resourceConfig: JSON.stringify({
        module: moduleInfo.relativeName,
        component: 'buttonLink',
        icon: { f7: '::search' },
        actionPath: '/a/basefront/atom/searchQuick',
        scene: 'sidebar',
        sceneOptions: { side: 'right', name: 'search', title: 'Search' },
      }),
      resourceRoles: 'root',
    },
    {
      atomName: 'Home',
      atomStaticKey: 'buttonHome',
      atomRevision: -1,
      atomCategoryId: 'a-layoutpc:button.General',
      resourceType: 'a-layoutpc:button',
      resourceConfig: JSON.stringify({
        module: moduleInfo.relativeName,
        component: 'buttonLink',
        icon: { f7: '::home' },
        actionPath: '/a/dashboard/dashboard?key=home',
        scene: 'dashboard',
        sceneOptions: { name: 'home' },
      }),
      resourceRoles: 'root',
    },
    {
      atomName: 'Dashboard',
      atomStaticKey: 'buttonDashboard',
      atomRevision: -1,
      atomCategoryId: 'a-layoutpc:button.General',
      resourceType: 'a-layoutpc:button',
      resourceConfig: JSON.stringify({
        module: moduleInfo.relativeName,
        component: 'buttonLink',
        icon: { f7: '::dashboard' },
        actionPath: '/a/dashboard/dashboard',
        scene: 'dashboard',
        sceneOptions: { name: 'dashboard' },
      }),
      resourceRoles: 'root',
    },
    {
      atomName: 'Fullscreen',
      atomStaticKey: 'buttonFullscreen',
      atomRevision: 0,
      atomCategoryId: 'a-layoutpc:button.General',
      resourceType: 'a-layoutpc:button',
      resourceConfig: JSON.stringify({
        module: moduleInfo.relativeName,
        component: 'buttonFullscreen',
      }),
      resourceRoles: 'root',
    },
    {
      atomName: 'Mine',
      atomStaticKey: 'buttonMine',
      atomRevision: 0,
      atomCategoryId: 'a-layoutpc:button.General',
      resourceType: 'a-layoutpc:button',
      resourceConfig: JSON.stringify({
        module: moduleInfo.relativeName,
        component: 'buttonMine',
        icon: { f7: '::person' },
        actionPath: null,
        scene: 'sidebar',
        sceneOptions: { side: 'right', module: 'a-layoutpc', name: 'panelMine' },
        showSeparator: true,
        fixed: true,
      }),
      resourceRoles: 'root',
    },
    {
      atomName: 'Clock',
      atomStaticKey: 'buttonClock',
      atomRevision: 0,
      atomCategoryId: 'a-layoutpc:button.General',
      resourceType: 'a-layoutpc:button',
      resourceConfig: JSON.stringify({
        module: moduleInfo.relativeName,
        component: 'buttonClock',
        actionPath: '/a/layoutpc/button/clock/preferences',
        scene: 'sidebar',
        sceneOptions: { side: 'right', name: 'preferences', title: 'Preferences' },
      }),
      resourceRoles: 'root',
    },
    {
      atomName: 'Copyright',
      atomStaticKey: 'buttonCopyright',
      atomRevision: 1,
      atomCategoryId: 'a-layoutpc:button.General',
      resourceType: 'a-layoutpc:button',
      resourceConfig: JSON.stringify({
        module: moduleInfo.relativeName,
        component: 'buttonLink',
        icon: { f7: '::copyright' },
        actionPath: '/a/basefront/base/about',
        scene: 'sidebar',
        sceneOptions: { side: 'right', name: 'about', title: 'About' },
        showLabel: true,
      }),
      resourceRoles: 'root',
    },
    {
      atomName: 'ViewLayout',
      atomStaticKey: 'buttonViewLayout',
      atomRevision: 2,
      atomCategoryId: 'a-layoutpc:button.General',
      resourceType: 'a-layoutpc:button',
      resourceConfig: JSON.stringify({
        module: moduleInfo.relativeName,
        component: 'buttonLink',
        icon: { f7: ':outline:layout-outline' },
        actionPath: '/a/user/view/pc',
        scene: 'sidebar',
        sceneOptions: { side: 'right', name: 'viewLayout', title: 'ViewLayout' },
        showLabel: false,
      }),
      resourceRoles: 'root',
    },
    {
      atomName: 'Theme',
      atomStaticKey: 'buttonTheme',
      atomRevision: 2,
      atomCategoryId: 'a-layoutpc:button.General',
      resourceType: 'a-layoutpc:button',
      resourceConfig: JSON.stringify({
        module: moduleInfo.relativeName,
        component: 'buttonLink',
        icon: { f7: ':outline:theme-outline' },
        actionPath: '/a/user/Theme',
        scene: 'sidebar',
        sceneOptions: { side: 'right', name: 'theme', title: 'Theme' },
        showLabel: false,
      }),
      resourceRoles: 'root',
    },
  ];
  return resources;
};
